package com.op.teachingliteapp.bean;

import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

import com.op.teachingliteapp.common.Common;
import com.op.teachingliteapp.database.table.UserTable;

/**
 * Created by Genji on 2015/6/27. Modified by Kevin
 */
public class UserBean extends BaseBean {
	private String id;
	private String name;
	private String password;
	private String number;
	private String phone;
	private String email;
	private String imageUrl;
	private String isUsing;
	private String type;

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.contentValues.put(UserTable.COLUMN_PASSWORD, password);
		this.password = password;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.contentValues.put(UserTable.COLUMN_NUMBER, number);
		this.number = number;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.contentValues.put(UserTable.COLUMN_PHONE, phone);
		this.phone = phone;

	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.contentValues.put(UserTable.COLUMN_EMAIL, email);
		this.email = email;
	}

	public String getIsUsing() {
		return isUsing;
	}

	public void setIsUsing(String isUsing) {
		this.contentValues.put(UserTable.COLUMN_IS_USING, isUsing);
		this.isUsing = isUsing;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.contentValues.put(UserTable.COLUMN_TYPE, type);
		this.type = type;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.contentValues.put(UserTable.COLUMN_ID, id);
		this.id = id;
	}

	public String getImageUrl() {
		return imageUrl;
	}

	public void setImageUrl(String imageUrl) {
		this.contentValues.put(UserTable.COLUMN_IMAGE_URL, imageUrl);
		this.imageUrl = imageUrl;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.contentValues.put(UserTable.COLUMN_NAME, name);
		this.name = name;
	}

	@Override
	public void fillAttributeByJson(JSONObject jsonObject) {
		setId(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_ID));
		setCreateTime(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_CREATE_TIME));
		setUpdateTime(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_UPDATE_TIME));
		setName(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_NAME));
		setPassword(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_PASSWORD));
		setNumber(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_NUMBER));
		setPhone(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_PHONE));
		setEmail(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_EMAIL));
		setImageUrl(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_IMAGE_URL));
		setIsUsing(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_IS_USING));
		setType(getJsonValue(jsonObject, UserTable.TABLE_USER, UserTable.COLUMN_TYPE));
	}

}
